<template>
	<div>
		<video ref="video" controls loop="false" width="1000"></video>
	</div>
</template>

<script>
import Hls from 'hls.js'
export default {
	mounted() {
		if (Hls.isSupported()) {
			var video = this.$refs.video
      var hls = new Hls()
			// hls.loadSource('http://192.168.4.180:6677/mytest/playlist.m3u8')
			hls.loadSource('https://yunqivedio.alicdn.com/2017yq/v2/0x0/96d79d3f5400514a6883869399708e11/96d79d3f5400514a6883869399708e11.m3u8')
			hls.attachMedia(video)
			hls.on(Hls.Events.MANIFEST_PARSED, function() {
				video.play()
			})
		}
	}
}
</script>
